project(RV1126_CGI)
cmake_minimum_required(VERSION 3.8)
message(STATUS "cmake version ${CMAKE_VERSION}")

set(TOOLCHAIN_DIR /opt/atk-dlrv1126-toolchain)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/usr/bin/arm-linux-gnueabihf-g++)
set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/usr/bin/arm-linux-gnueabihf-gcc)
set(SYSROOT ${TOOLCHAIN_DIR}/arm-buildroot-linux-gnueabihf/sysroot/usr/include)
set(CMAKE_SYSROOT ${TOOLCHAIN_DIR}/arm-buildroot-linux-gnueabihf/sysroot)

set(CMAKE_CXX_STANDARD 11)
# add_definitions(-g -O0 -ggdb -gdwarf -funwind-tables -rdynamic -fpermissive)
add_definitions(-g -O0 -ggdb -gdwarf -funwind-tables -rdynamic)
add_definitions(-Wno-write-strings -Wno-return-type)

set(OPENCV_LIBS opencv_core opencv_imgcodecs opencv_imgproc opencv_features2d opencv_flann opencv_highgui opencv_freetype)

# include_directories(${CMAKE_CURRENT_LIST_DIR})

#CGI程序
add_executable(capture.cgi capture.c cgic.c)

add_executable(scan_dir_cgi.cgi scan_dir_cgi.c cgic.c)

add_executable(scan_video_cgi.cgi scan_video_cgi.c cgic.c)

add_executable(start_fifo_cgi.cgi start_fifo_cgi.c cgic.c)

add_executable(stop_fifo_cgi.cgi stop_fifo_cgi.c cgic.c)

add_executable(index_button.cgi index_button.c cgic.c cJSON/cJSON.cpp)

add_executable(snap_rv1126_vdec_picture.cgi snap_rv1126_vdec_picture.c cgic.c)

add_executable(start_record_cgi.cgi start_record_cgi.c cgic.c)

add_executable(stop_record_cgi.cgi stop_record_cgi.c cgic.c)

add_executable(save_ffmpeg_config.cgi save_ffmpeg_config.c cgic.c cJSON/cJSON.cpp)
add_executable(save_mp4_config.cgi save_mp4_config.c cgic.c cJSON/cJSON.cpp)


add_executable(sharemeomory_vdec_cgi.cgi sharemeomory_vdec_cgi.cpp)
target_link_libraries(sharemeomory_vdec_cgi.cgi ${OPENCV_LIBS})

add_executable(sharemeomory_vdec_param.cgi sharemeomory_vdec_param.cpp)



